using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Scurvy.Media
{
    /// <summary>
    /// Stores all of a video's content in memory for fast playback
    /// </summary>
    public class VideoInMemory : Video
    {
        private List<Texture2D> _textures;

        public VideoInMemory(int numberOfFrames, double frameRate)
            : base(numberOfFrames, frameRate)
        {
            _textures = new List<Texture2D>(numberOfFrames);
        }

        public override Texture2D CurrentTexture
        {
            get { return _textures[this.CurrentIndex]; }
        }

        internal void Add(Texture2D tex)
        {
            _textures.Add(tex);
        }
    }
}
